package com.huawei.petapp2.provider;



import androidx.appcompat.widget.AppCompatImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.huawei.petapp2.R;
import com.huawei.petapp2.adapter.TestHomeAdapter;
import com.huawei.petapp2.entity.Recomment;


/**
 * Created by 吕氏春秋i 2020/4/30
 * Describe:
 */


public class ImgItemProvider extends BaseItemProvider<Recomment, BaseViewHolder> {
    @Override
    public int viewType() {
        return TestHomeAdapter.TYPE_IMG;
    }

    @Override
    public int layout() {
        return R.layout.app_item_home_img;
    }

    @Override
    public void convert(BaseViewHolder helper, Recomment data, int position) {
        Glide.with(mContext)
                .load(data.getImgs().get(0))
                .dontAnimate()
                .into((AppCompatImageView) helper.getView(R.id.item_img));
    }
}
